package com.easybuilder.core.rbac.dao;

import com.easybuilder.common.base.dao.BaseDao;
import com.easybuilder.core.rbac.entity.SysRole;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.ExampleMapper;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface SysRoleDao extends BaseDao<SysRole>, ExampleMapper<SysRole> {

    /** 根据userid获取角色列表
     * @param userId*/
    @Select("select a.* from sys_role a join sys_user_role b on a.id = b.role_id where b.user_id = #{userId}")
    List<SysRole> getByUserId(Long userId);
}